import { pubRequire } from '@utils/public'
const baseUrl = '/advertisements'
// 获取列表
export function getAdverList(obj, callBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callBack, errBack)
}
// APP广告新增
export function addAdvert(obj, callBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callBack, errBack)
}
// 根据id获取编辑页详情
export function getEditAdvert(id, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}`, '', callBack, errBack)
}
// App广告修改
export function editAdvert(id, obj, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, callBack, errBack)
}
// 删除单个
export function delAdvert(id, callBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, '', callBack, errBack)
}
// 启用欢迎页
export function putEnable(id, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/open`, '', callBack, errBack)
}
// 关闭欢迎页
export function putDisable(id, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/close`, '', callBack, errBack)
}
